//Accepted
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <iostream>
#include <list>
#include <deque>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;
bool pp[1041];
char s[21];
int  sum, i, j;

bool init(){
	pp[0]=0;
	for(i=2;i<1041;++i){
		if(pp[i])
		for(j=i+i;j<1041;j+=i)pp[j]=0;
	}
}

int main (){
	//freopen("in.txt", "r", stdin);//freopen("out.txt", "w", stdout);
	memset(pp,1, sizeof(pp));
	init();
	while(scanf("%s\n", s)==1){
		sum=0;
		for(i=0;s[i];++i){
			if(s[i]>='A'&&s[i]<='Z')sum+=(s[i]-'A'+27);
			else if(s[i]>='a'&&s[i]<='z')sum+=(s[i]-'a'+1);
		}
		if(pp[sum])printf("It is a prime word.\n");
		else printf("It is not a prime word.\n");
	}
	return 0;
}
